<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>内容管理</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
          integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
    <link rel="stylesheet" href="../bootstrap/css/style.css">
    <link rel="stylesheet" href="../bootstrap/css/font-awesome(1).css">
    <link rel="stylesheet" href="../bootstrap/css/nprogress.css">
    <link rel="stylesheet" href="../css/index.css">
    <link rel="stylesheet" href="../css/program.css">
</head>

<body>
<div class="wrapper">
    <jsp:include page="./leftSidebar.jsp"></jsp:include>
    <div class="aside">
        <div class="widgets">
            <h4>搜索</h4>
            <div class="body search">
                <form action="search.jsp">
                    <input type="text" class="keys" id="keys" placeholder="输入关键字">
                    <input type="button" class="btn" id="SearchBtn" value="搜索">
                </form>
            </div>
        </div>
        <div class="widgets">
            <h4>随机推荐</h4>
            <ul class="body random">
                <li>
                    <a href="javascript:;">
                        <p class="title">TV动画《满溢的水果挞将于2020年10月播出。</p>
                        <p class="reading">阅读(819)</p>
                        <div class="pic">
                            <img src="../uploads/right1.jpg" alt="">
                        </div>
                    </a>
                </li>
                <li>
                    <a href="javascript:;">
                        <p class="title">TV动画《EX-ARM》于2021年1月10日播出</p>
                        <p class="reading">阅读(906)</p>
                        <div class="pic">
                            <img src="../uploads/right2.jpg" alt="">
                        </div>
                    </a>
                </li>
                <li>
                    <a href="javascript:;">
                        <p class="title">手游《Fate/Grand》配信5周年纪念动画PV公开</p>
                        <p class="reading">阅读(509)</p>
                        <div class="pic">
                            <img src="../uploads/right3.jpg" alt="">
                        </div>
                    </a>
                </li>
                <li>
                    <a href="javascript:;">
                        <p class="title">芳文社漫画改编动画《满溢的水果塔》追加声优</p>
                        <p class="reading">阅读(679)</p>
                        <div class="pic">
                            <img src="../uploads/right4.jpg" alt="">
                        </div>
                    </a>
                </li>
                <li>
                    <a href="javascript:;">
                        <p class="title">TV动画《天使与龙的轮舞》将推出蓝光BOX。</p>
                        <p class="reading">阅读(889)</p>
                        <div class="pic">
                            <img src="../uploads/right5.jpg" alt="">
                        </div>
                    </a>
                </li>
            </ul>
        </div>
    </div>
    <div class="content">
        <div class="panel hots content11">
            <div class="row" style="height: 50px">
                <div class="col-sm-4" style="height: 50px">
                    <h3 style="margin-top: 0">内容管理</h3>
                </div>
                <div class="col-sm-7" style="height: 50px">
                </div>
                <div class="col-sm-1" style="height: 50px">
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../bootstrap/js/jquery/jquery.js"></script>
<script src="../bootstrap/js/nprogress/nprogress.js"></script>
<script type="text/javascript">
    $(function () {
        $('#SearchBtn').click(function () {
            var keys = $('#keys').val().trim();
            location.href = './search.do?action=page&name=' + keys;
        })
    })
</script>
<script type="text/javascript">
    function videoDelete(a){
        let videoId = $(a).parent().children('input').prop('value');
        $.ajax({
            url :'./user.do',
            data: {action : 'videoDelete',videoId:videoId},
            success : function () {
                location.href = './production.jsp'
            }
        })
    }

    $(function () {
        $.ajax({
            url : "./user.do",
            data : { action : "manage"},
            success : function (data) {
                for (let i = 0; i < data.length; i++) {
                    let video = data[i];
                    var html = '<ul style="margin-bottom: 22px; border-bottom: solid 2px #e4e4e4;height: 160px;width: 868px " >';
                    //添加隐藏输入框 设置input值
                    html+='<input type="hidden" value="' +video.id + '">';
                    //添加视频连接
                    html+= '<li style="float: left"><a href="./video.jsp?videoUrl=' + video.url+ '&videoImg='+video.videoImg+'&videoId='+video.id+'&name='+video.name+'&describe='+video.describe +'"'  +
                        '><img src="/fantasy/videoUpload/' +video.videoImg +'" alt="" style="cursor:pointer"></a>';
                    //设置后续内容
                    html+='</li><li style="float: left;margin-top: 48px;font-size: 16px;font-weight: bold">'+video.name +'</li><li style="float: left;margin-top: 50px;margin-left:100px">审核通过</li>';
                    html+='<li  onclick="videoDelete(this)" style="float: left;margin-left:50px;margin-top: 46px; height: 32px;width: 32px;border-radius: 50%;background: #e4e4e4"><i class="fa fa-trash-o fa-2x" style="margin-left: 5px;margin-top: 3px;cursor:pointer"></i></li></ul>';

                    $(".content11").append(html);
                }
            }
        })
    })
</script>
</body>

</html>